package com.kazimsoylu;

import net.sf.jml.MsnMessenger;
import net.sf.jml.MsnProtocol;
import net.sf.jml.impl.MsnMessengerFactory;

public class MessengerFunctions 
{
	public static boolean signIn( String address, String password )
	{
		
		MsnMessenger messenger = MsnMessengerFactory.createMsnMessenger( address, password );
		messenger.setSupportedProtocol(new MsnProtocol[] {MsnProtocol.MSNP12});
		messenger.setLogIncoming(false);
		messenger.setLogOutgoing(false);
		messenger.addMessengerListener( new MsnListener() );
		messenger.login();
		
		messenger.addMessageListener( new IncomingMessageHandler() );
		messenger.addContactListListener( new ContactListHandler() );
		
		Application.messenger = messenger;
		
		return true;
	}

}
